package com.example.second;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.second.adapter.AdapterActivity;
import com.example.second.chain.ChainActivity;
import com.example.second.command.CommandActivity;
import com.example.second.iterator.IteratorActivity;
import com.example.second.mediator.MediatorActivity;
import com.example.second.memo.MemoActivity;
import com.example.second.observer.ObserverActivity;
import com.example.second.proxy.ProxyActivity;
import com.example.second.state.StateActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.btn_main_observer)
    Button btnMainObserver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn_main_observer,
            R.id.btn_main_factory,
            R.id.btn_main_proxy,
            R.id.btn_main_state,
            R.id.btn_main_adapter,
            R.id.btn_main_memo,
            R.id.btn_main_iterator,
            R.id.btn_main_command,
            R.id.btn_main_chain,
            R.id.btn_main_mediator})
    public void onViewClicked(View view) {
        Intent intent = null;
        switch (view.getId()) {
            case R.id.btn_main_observer:
                intent = new Intent(MainActivity.this, ObserverActivity.class);
                break;
            case R.id.btn_main_factory:
                break;
            case R.id.btn_main_proxy:
                intent = new Intent(MainActivity.this, ProxyActivity.class);
                break;
            case R.id.btn_main_state:
                intent = new Intent(MainActivity.this, StateActivity.class);
                break;
            case R.id.btn_main_adapter:
                intent = new Intent(MainActivity.this, AdapterActivity.class);
                break;
            case R.id.btn_main_memo:
                intent = new Intent(MainActivity.this, MemoActivity.class);
                break;
            case R.id.btn_main_iterator:
                intent = new Intent(MainActivity.this, IteratorActivity.class);
                break;
            case R.id.btn_main_command:
                intent = new Intent(MainActivity.this, CommandActivity.class);
                break;
            case R.id.btn_main_chain:
                intent = new Intent(MainActivity.this, ChainActivity.class);
                break;
            case R.id.btn_main_mediator:
                intent = new Intent(MainActivity.this, MediatorActivity.class);
                break;
        }
        if (intent != null) {
            startActivity(intent);
        }
    }
}
